<?php

namespace Push\Payloads;

class TitleBodyPayload extends AbstractPayload
{
    /**
     * @var string 推送消息的标题
     */
    private $title;

    /**
     * @var string 推送消息的内容
     */
    private $body;

    /**
     * TitleBodyPayload constructor.
     *
     * @param string $title
     * @param string $body
     * @param array $extraMessage
     */
    public function __construct($title = '', $body = '', $extraMessage = [])
    {
        $this->title = $title;
        $this->body = $body;
        $this->extraMessage = $extraMessage;
    }

    /**
     * @return array|string
     */
    public function alert()
    {
        return [
            'title' => $this->title,
            'body' => $this->body
        ];
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
    }

    /**
     * @return string
     */
    public function getBody()
    {
        return $this->body;
    }

    /**
     * @param string $body
     */
    public function setBody($body)
    {
        $this->body = $body;
    }
}
